const { readFileSync } = require("fs")
const path = require("path")
const { root } = require("../global")
const renderJS = (url, content) => {
  return '# ' + url + '\n' +
    '```javascript\n' +
    content +
    '\n```\n' +
    '`'
}
module.exports = (url, [docs, name]) => {
  url = url.replace('.md', '')
  return renderJS(url, readFileSync(path.join(root, url)).toString())
}